<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>广东省传播平台-业务计提明细（统购及总体）</title>
<link rel="stylesheet" type="text/css" href="<%=path%>/css/common.css" />
<link rel="stylesheet" type="text/css" href="<%=path%>/css/tag.css" />
<script type="text/javascript" src="<%=path%>/js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="<%=path%>/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">

	//搜索 
	function doSearch(url)
	{	
		if(searchM()){
		document.forms[0].action=url;
		document.forms[0].submit();
		}
	}
	function searchM(){
		var myReg =/^[\s\dA-Za-z\u4E00-\u9FA5]+$/;  
        var kw = trim(document.getElementById("keyword1").value);
        
        if (kw != null && kw != '' && !myReg.test(kw)) {
		    alert("关键字中含非法字符，请重新输入！");
		    document.getElementById('keyword1').focus();
		    return false;
          }
        else if(kw == "输入关键字检索"){
        kw = ""}
        $("#keyword").val(kw);
		return true;
	}
	function trim(str) 
		{
		str = str.replace( /^\s*/, "");
		str = str.replace( /\s*$/, "");
		str = str.replace( /^[" "|"　"]*/, "");
		str = str.replace( /[" "|"　"]*$/, ""); 
		return str;
	} 
	function pageSub(currentPage) {
		var reg=/^\d*?$/;
		var total =${page.totalPages};
	    if(reg.test(currentPage)){
			if(currentPage > total){
				$("#currentPage").val(total);
			}else{
				$("#currentPage").val(currentPage);
			}			 	
			document.forms[0].submit();
		}else{
			alert("请输入数字!"); 
		}
	}	
	
	//重置
	function resetCon()
	{
		var myDate = new Date();
		yearMonth = myDate.getFullYear()+"-" + ((myDate.getMonth()+1)<10?"0":"")+(myDate.getMonth()+1);
		$("#EndTime").val(yearMonth);//当前年月 
		$("#accrualCity").val("${logUser.usercity}");//归属地市下拉 
		$("#mediaType").val("");//媒体类型下拉 
		$("#keyword1").val("输入关键字检索");//关键字 
	}
	
	$(function(){
        //selectNav('nav6');

        $( "#queryTab ul li" ).mouseover(function(){
    		var cssName = $(this).attr("class");
    		if(cssName != "focus"){
    			$(this).attr("class", "onfocus");
    		}
    	});
    	
    	$( "#queryTab ul li" ).mouseout(function(){
    		var cssName = $(this).attr("class");
    		var col = $(this).children( "a" ).css("color");
    		if(cssName == "onfocus" && col !="#ffffff"){
    			$(this).attr("class", "no_select_li_hover");
    		}
    	});
    	$( "#queryTab ul li" ).click(function(){
    		$( "#queryTab ul li" ).attr("class", "no_select_li_hover");
    		$( "#queryTab ul li" ).children( "a" ).css("color", "#000000");
    		$(this).attr("class", "focus");
    		$(this).children( "a" ).css("color", "#ffffff");

    	});
	});
  
</script>

<style>
	#queryTab{
		height:32px;
		font-size:14px;
	}
	#queryTab ul li {
		height:32px;
		width:142px;
		line-height:32px;
		text-align:center;
		font-size:14px;
		font-weight:bold;
					
		float:left;
		padding:0px;
		margin:0px;
		border:0;
	}
	#queryTab ul li a{ color:#000000; display:block; line-height:32px;}
	#queryTab .focus{
		background:url("images/statetab_select.jpg") no-repeat ;
		color:#FFFFFF;
	}
	#queryTab .onfocus{ 
		background:url("images/statetab_select.jpg") no-repeat; 
		color:#FFFFFF;
	}	
	.no_select_li_hover{
	    background:url("images/statetab_unselect.jpg") no-repeat ;
		color:#000000;
	}	

</style>
</head>

<body>
<!-- 顶栏start -->
<jsp:include page="../common/top.jsp"></jsp:include>
<!-- 顶部end -->

<!-- 顶部start -->
<div id="main">
	<div class="body">
	<jsp:include page="../common/nav.jsp"></jsp:include>
		<!-- 主体 -->
		<div class="main_body">
		<form id="form" action="totalAccrualAction.action" method="post" style=margin-bottom:0;>
		<input type="hidden" name="currentPage" id="currentPage" />
		<div id="queryTab" style="width:100%">
         <ul>
			  <li class="focus"><a href="#" style="color:#FFFFFF;" onclick="window.location.href='totalAccrualAction.action';" > (统购及总体)计提明细</a></li>
              <li class="no_select_li_hover"><a href="#"  onclick="window.location.href='backAccrualAction.action';" >(备选)计提明细</a></li> 
			  <li class="no_select_li_hover" ><a href="#" onclick="window.location.href='contractAccrualAction.action';" > (合同)计提明细</a></li> 
		 </ul>
		</div>
		<hr size='5px' color='#f26223' style="margin:0; width=100%;" />
			<table class="condition bg1" style="width:100%; font-size:14px; font-weight:bold; color:#000000;" align="center"
			 onkeydown="if(event.keyCode==13) document.getElementById('searchk').click();">
             <tr style="height:40px;">
             <td width="10%" style="text-align:right;"><label>计提截止时间：</label>  </td>
              	<td width="15%"> <input id = "EndTime" name="totalAccrualEndTime" type="text" class="Wdate text"  
					style="width:150px;" onfocus="WdatePicker({dateFmt:'yyyy-MM'})" value="${totalAccrualEndTime}" readonly="readonly" />             </td>
				<td width="15%">
					<s:select id="accrualCity" name="accrualCity" list="dataListCITY" listKey="id" listValue="datavalue" >
					</s:select>
				</td>
				<td width="15%">
			       <s:select id="mediaType" name = "mediaType" list="mediaTypeSelect" listKey="id" listValue="datavalue" headerKey="" headerValue="--媒体类型--"></s:select>
			    </td>
              <td width="8%" style="text-align:right;"><label>媒体名称：</label></td>
			  <td width="15%">
              <s:if test="keyword == null || keyword == ''">
			     <input id="keyword1"  type="text" class="text" value="输入关键字检索" onfocus="if($(this).val() == '输入关键字检索'){$(this).val('');}" />
			  </s:if>
			  <s:else>
				<input id="keyword1"  type="text" class="text" value="${keyword}" onfocus="if($(this).val() == '输入关键字检索'){$(this).val('');}" />
			  </s:else></td>
			  <td width="22%"><input id = "searchk" name="button" type="button" class="btn-title" value="搜索" onclick="doSearch('totalAccrualAction.action');"/>   
			  &nbsp;&nbsp;&nbsp;
			  <input name="button" type="button" class="btn-title" value="重置" onclick="resetCon();" />        							 			  
 			  </td>
			</tr>
		 </table>
		 <input type="hidden" id="keyword" name="keyword" value="${keyword }" />
		</form>	
			<div id="list_div">
				<table class="table_list" style="width:100%;">
					<tr class="bg1">
						<th rowspan="2">媒体类型</th>
						<th rowspan="2">媒体名称</th>
						<th rowspan="2">计划投放量</th>
						<th rowspan="2">累计实际投放金额</th>
						<th colspan="2">其中</th>
						<th rowspan="2">当月计划投放量</th>
						<th rowspan="2">当月实际完成值</th>
						<th rowspan="2">计提金额</th>
						<th rowspan="2">累计实际投放金额进度</th>
					</tr>
					<tr>
						<th>固定累计实际投放金额</th>
						<th>浮动累计实际投放金额</th>
					</tr>
					<s:iterator value="itemAccruals" id="ta" >
					<s:if test="#ta.mediaType == '合计' || #ta.mediaName == '小计'">
					<tr style="background-color:#ffffaa">
					</s:if>
					<s:else>
					<tr>
					</s:else>
						<td>${ta.mediaType}</td>
						<td>
						<s:if test="#ta.mediaName.length()>10">
							<label title="${ta.mediaName}">
								<s:property value="#ta.mediaName.substring(0,10)+'...'" />
							</label>
						</s:if>
						<s:else>
							<s:property value="#ta.mediaName" />
						</s:else>
						</td>
						<td><fmt:formatNumber value='${ta.totalPlan}'maxFractionDigits ="3"/></td>
						<td><fmt:formatNumber value='${ta.totalReal}'maxFractionDigits ="3"/></td>
						<td><fmt:formatNumber value='${ta.firmReal}'maxFractionDigits ="3"/></td>
						<td><fmt:formatNumber value='${ta.flowReal}'maxFractionDigits ="3"/></td>
						<td><fmt:formatNumber value='${ta.currentplan}'maxFractionDigits ="3"/></td>
						<td><fmt:formatNumber value='${ta.currentReal}'maxFractionDigits ="3"/></td>
						<td><fmt:formatNumber value='${ta.accrualAmount}'maxFractionDigits ="3"/></td>
						<td><fmt:formatNumber value="${ta.putPercent}" type="percent" maxFractionDigits ="2"/></td>
					</tr>
				</s:iterator>
				</table>
				<!-- 分页start -->
				<jsp:include page="/jsp/common/page.jsp"></jsp:include>
				<!-- 分页end -->
		  </div>
	  </div>
	</div>
</div>
<!-- 顶部end -->

<!-- 底部start -->
		<jsp:include page="/jsp/common/bottom.jsp"></jsp:include> 
<!-- 底部end -->
</body>
</html>
